<?php
include_once("./_common.php");

$sql = "SELECT a.id, a.ntc_id, a.mb_id, a.view_date, b.mb_name, c.ntc_title
		  FROM notice_view_history a, g4_member b, notice_record c
		 where a.mb_id = b.mb_id
		   and a.ntc_id = c.id
		   and a.ntc_id = '$ntc_id'
		 order by view_date DESC";
$rst = sql_query($sql);

while($row = mysql_fetch_assoc($rst))
{
	$list[] = $row;
}

$result = "";

for ($i=0; $i<count($list); $i+=1)
{
	$result .= $list[$i]['id']."<col>".$list[$i]['ntc_title']."<col>".$list[$i]['view_date']."<col>".$list[$i]['mb_name']."<col>END"."<row>";
}

echo($result);

?>